package com.tangchao.client.sdh.view
{
	import com.tangchao.client.entities.User;
	import com.tangchao.client.sdh.vo.RoleInfoVo;
	
	import flash.display.MovieClip;
	import flash.text.TextField;

	public class RoleInfo extends MovieClip
	{
		private var _vo:User;
		private var _nickName:TextField;
		private var _huoli:TextField;
		private var _exp:TextField;
		private var _money:TextField;
		public function RoleInfo()
		{
			init();
		}
		
		private function init()
		{
			_nickName=getChildByName("tfNickName") as TextField;
			_huoli=getChildByName("tfHuoLi") as TextField;
			_exp=getChildByName("tfExp") as TextField;
			_money=getChildByName("tfMoney") as TextField;
		}
		
		/*
		*创建角色自己的信息
		*/
		public function create(v:User)
		{
			_vo=v;
			updataView();
		}
		
		public function updataView()
		{
			if(_vo)
			{
				_nickName.text=_vo.getName();
				_huoli.text= "活力："+_vo.getVigour().toString();
				_exp.text="经验:"+_vo.getExperience().toString();
				_money.text="金钱:"+_vo.getCredit().toString();
			}
		}
	}
}